package com.ibm.cps.message.validation;

import com.fasterxml.jackson.databind.node.ObjectNode;
import com.ibm.cps.message.MessageFields;
import com.ibm.util.exception.CPSException;

public class SQLValidator extends IProcessorValidator {

	@Override
	public void validatePostMessage(ObjectNode element) throws CPSException {
		String[] strFields = { MessageFields.PROCESSOR_GROUP_CONTENT, MessageFields.NAME,
				MessageFields.TYPE };
		ValidatorUtil.validateStringFields(element, strFields);
		ValidatorUtil
				.assignRandomIdIfNotPresent(element, MessageFields.GROUPID);
	}

	@Override
	public String getProcessorid(ObjectNode object) throws CPSException {
		return getProcessorid(object, MessageFields.GROUPID);
	}
}
